<?php $this->load->view('header'); ?>
<?php
	$name_pr = '';
	$id_group ='';
	$des = '';

    if(isset($same_project)){
        $name_pr = $same_project->project_name;
        $id_group = $same_project->group_id;
        $des = $same_project->description;
    }else if(isset($projectTemplate)){
        $name_pr = $projectTemplate->project_name;
        $id_group = $projectTemplate->group_id;
        $des = $projectTemplate->description;
    }
?>
    <div class="wrap-content wrap-project">
        <div class="container">
            <div class="detail-profile">
                <div class="border col-md-1 col-xs-1"></div>
                <div class="container">
                    <div class="row title-project">
                        <h1><?php echo $this->lang->line("Detail project") ?></h1>
                    </div>
                </div>
                <div class="col-lg-12">
                    <?php if(validation_errors() != null){?>
                    <div class="alert alert-danger">
                        <button data-dismiss="alert" class="close"></button>
                        <i class="fa fa-times-circle"></i>
                        <strong><?php echo $this->lang->line('Message')?></strong>
                        <ul>
                            <?php echo validation_errors('<li>', '</li>'); ?>
                        </ul>
                    </div>
                    <?php } ?>
                    <form method="POST" id="form-project-post" enctype="multipart/form-data">
                        <div class="row">
                        	<?php if($projectTemplates->num_rows() > 0 && !isset($same_project) && !$this->input->get('backUrl',TRUE)){ ?>
                        	<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Project template') ?></div>
                            </div>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding">
                                    <?php
                                    	foreach ($projectTemplates->result() as $item) {
											echo "<label class='label-template'>";
											if(isset($templateId) && $templateId == $item->id){
												echo "<input type='radio' name='template' value=".$item->id." checked/>";
											}else{
												echo "<input type='radio' name='template' value=".$item->id." />";	
											}
                                            
                                            echo $item->project_name."</label>";
                                        }
                                     ?>
                                </div>
                            </div>
                            <?php } ?>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div
                                    class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Project Name') ?></div>
                            </div>

                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-6 col-sm-12 col-md-12 col-xs-12 no-padding form-group">
                                    <input type="text" name="project_name" id="project-name" class="form-control"
                                           placeholder="Nhập tên dự án..."
                                           value="<?php echo set_value('project_name', $name_pr); ?>"/>
                                    <?php echo form_error('project_name') ?>
                                </div>
                            </div>

                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('What work do you require'); ?></div>
                            </div>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-6 col-sm-6 col-md-6 col-xs-12 form-group no-padding ">
                                        <?php
                                            $group_parent[''] = $this->lang->line("Please select");
                                            foreach ($groupParent->result() as $item) {
                                                $group_parent[$item->id] = $item->group_name;
                                            }
                                            if(($this->input->post('group_parent'))) {
                                                $selected = $this->input->post('group_parent');
                                            }elseif(isset($groupParentSelect)) {
                                                $selected = $groupParentSelect->parent_id;
                                            }else{
                                                $selected = '';
                                            }

                                            echo form_dropdown('group_parent', $group_parent, $selected, 'id="ParentCategory" class="form-control" onchange="javascript:ajaxgetChildCategory();"');
                                        ?>
                                        <?php echo form_error('group_parent') ?>
                                </div>
                                <div id="ChildCategory" class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding form-group child-category">
                                    <?php

                                        if(isset($groupSelect)){
                                            foreach($groupSelect as $item){
                                                if(isset($same_project)){
                                                    $group_ids = explode(',', $same_project->group_ids);
                                                }

                                                if(($this->input->post('group')) && in_array($item['id'], $this->input->post('group'))){
                                                    $selected = true;
                                                }elseif((isset($projectTemplate) && $projectTemplate->group_id == $item['id']) ||
                                                    (isset($same_project) &&  in_array($item['id'], $group_ids))){
                                                    $selected = true;
                                                }else{
                                                    $selected = false;
                                                }

                                                echo "<label class='label-category'>";
                                                if($selected == true){
                                                    echo "<input type='checkbox' name='group[]' checked value='".$item['id']."' />";
                                                }else{
                                                    echo "<input type='checkbox' name='group[]' value='".$item['id']."' />";
                                                }
                                                echo $item['group_name']."</label>";

                                                /*if($selected == true){
                                                    echo "<option value='".$item['id']."' selected>".$item['group_name']."</option>";
                                                }else{
                                                    echo "<option value='".$item['id']."'>".$item['group_name']."</option>";
                                                }*/
                                            }
                                        }
                                        ?>
                                    <!--
                                    <select id="ChildCategory" class="form-control groupCategories" multiple="multiple" name="group[]">
                                    </select>
                                    -->
                                    <?php echo form_error('group[]') ?>
                                </div>
                            </div>

                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('which divece are you targeting?'); ?></div>
                            </div>

                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding">
                                    <?php
                                    if ($devices->num_rows() > 0) {
                                        $deviceSelect = '';
                                        if(isset($same_project) && $same_project->device_ids != null){
                                            $deviceSelect = explode(',', $same_project->device_ids);
                                        }

                                        foreach ($devices->result() as $item) {
                                            //var_dump(($this->input->post('device')) && in_array($item->id, $this->input->post('device')));
                                            if(($this->input->post('device')) && in_array($item->id, $this->input->post('device'))){
                                                $checked = TRUE;
                                            }elseif($deviceSelect != '' && in_array($item->id, $deviceSelect)){
                                                $checked = TRUE;
                                            }else{
                                                $checked = FALSE;
                                            }

                                            echo "<label class='label-device'>";
                                            if($checked == true){
                                                echo "<input type='checkbox' name='device[]' checked value='".$item->id."' data-categories='".$item->project_categories."'/>";
                                            }else{
                                                echo "<input type='checkbox' name='device[]' value='".$item->id."' data-categories='".$item->project_categories."'/>";
                                            }
                                            echo $item->name."</label>";
                                        }
                                    }
                                    ?>
                                </div>
                            </div>

                            <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Enter some skills that relate to the project'); ?></div>
                            </div>

                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-6 col-sm-12 col-md-6 col-xs-12 no-padding list-skill">
                                    <select id="skills" data-placeholder="Select skills..." style="display: none;" multiple="" name="project_categories[]" class="chosen-select form-control">
                                        <?php
                                        if(isset($categoryGroups) && $categoryGroups->num_rows() > 0){
                                            if(isset($same_project)){
                                                $categoriesSelect = explode(',', $same_project->project_categories);
                                            }elseif(isset($projectTemplate)){
                                                $categoriesSelect = explode(',', $projectTemplate->project_categories);
                                            }elseif($this->input->post('project_categories')){
                                                $categoriesSelect = $this->input->post('project_categories');
                                            }

                                            foreach ($categories->result() as $item){
                                                if(array_search($item->id, $categoriesSelect)){
                                                    echo "<option value='".$item->id."' selected>".$item->category_name."</option>";
                                                }else{
                                                    foreach($categoryGroups->result() as $category){
                                                        if($category->id == $item->id){
                                                            echo "<option value='".$item->id."'>".$item->category_name."</option>";
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        ?>
                                    </select>
                                    <?php echo form_error('project_categories') ?>
                                </div>
                                <div class="sticky-skill col-md-12 no-padding">
                                    <?php
                                    if(isset($stickySkill) && $stickySkill->num_rows() > 0){
                                        if(($this->input->post('project_categories'))){
                                            $categoriesSelect = $this->input->post('project_categories');
                                        }elseif(isset($same_project)){
                                            $categoriesSelect = explode(',', $same_project->project_categories);
                                        }
                                        foreach($stickySkill->result() as $item){
                                            if(isset($categoriesSelect) && array_search($item->id, $categoriesSelect)) {
                                                echo '<label class="label-skill active-skill" data-value="' . $item->id . '">' . $item->category_name . '</label>';
                                            }else{
                                                echo '<label class="label-skill" data-value="' . $item->id . '">' . $item->category_name . '</label>';
                                            }
                                        }
                                    }
                                    ?>
                                </div>
                            </div>

                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Project Description') ?></div>
                            </div>

                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding form-group">
                                    <textarea class="form-control" id="project-description" name="description"
                                              placeholder="<?php //echo $this->lang->line("placeholder_detail"); ?>"
                                              rows="10"><?php echo set_value('description', $des); ?></textarea>
                                    <?php echo form_error('description') ?>
                                </div>
                            </div>

                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding margin-top-bottom">

                                <div class="fileinput fileinput-new col-lg-12 col-sm-12 col-md-12 col-xs-12 form-group" data-provides="fileinput">
                                    <div class="btn btn-default btn-lg btn-upload btn-file"><span class="fileinput-new">Upload file</span>
                                        <span class="fileinput-exists">Change</span>
                                        <input type="file" name="attachment">
                                    </div>
                                    <div class="col-lg-12 col-sm-12 col-md-12 file-item">
                                        <div class="fileinput-filename col-lg-11 col-sm-12 col-md-12 col-xs-12"></div>

                                        <a href="#" class="close fileinput-exists clip-close-3" data-dismiss="fileinput"
                                           style="float: none;font-size: 28px;line-height: 40px;"></a>
                                    </div>
                                    <?php echo form_error('attachment'); ?>
                                </div>
                            </div>

                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12">
                                <div
                                    class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Budget') ?></div>
                            </div>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding" style="margin-top:5px;">
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12 vnd">
                                    <select class="form-control">
                                        <option value="1">USD</option>
                                    </select>
                                </div>
                                <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 dan">
                                    <?php
                                    $selected = ($this->input->post('budget')) ? $this->input->post('budget') : 1;

                                    $budget = array(
                                        1 => $this->lang->line('Simple Project'),
                                        2 => $this->lang->line('Very Small Project'),
                                        3 => $this->lang->line('Small Project'),
                                        4 => $this->lang->line('Medium Project'),
                                        5 => $this->lang->line('Large Project'),
                                        6 => $this->lang->line('Larger Project'),
                                        'customize' => $this->lang->line('Customise Project')
                                    );
                                    echo form_dropdown('budget', $budget, $selected, "id='budget' class='form-control'");
                                    ?>
                                </div>

                                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="display: none"
                                     id="customize_budget">
                                    <span class="col-lg-12 col-md-12 col-sm-12 form-group"
                                          style="margin-top: 10px;"><?php echo $this->lang->line('Please specify custom budget'); ?></span>

                                    <div class="col-lg-12 form-group">
                                        <label class="col-lg-3 control-label"><?php echo $this->lang->line('Customize budget min') ?></label>
                                        <div class="col-lg-3 input-group budget">
                                        	<span class="input-group-addon">$</span>
                                            <input type="text" id="customize_budget_min" class="form-control" name="customize_budget_min" style="border-radius:0 5px 5px 0">

                                        </div>
                                    </div>
                                    <div class="col-lg-12 form-group">
                                        <label class="col-lg-3 control-label"><?php echo $this->lang->line('Customize budget max'); ?></label>
                                        <div class="col-lg-3 input-group budget">
                                        	<span class="input-group-addon">$</span>
                                            <input type="text" id="customize_budget_max" class="form-control" name="customize_budget_max" style="border-radius:0 5px 5px 0">
                                        </div>
                                    </div>
                                </div>


                            </div>

                            <?php if($this->config->item('escrow_min') != 0 && $this->config->item('escrow_max') != 0){?>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('escrow') ?></div>
                            </div>
							<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-6 col-sm-12 col-md-12 col-xs-12 no-padding input-group">
                                    <input type="text" name="escrow_due" id="escrow_due" class="form-control" style="border-radius: 5px 0 0 5px;" placeholder="Example: 500"
                                           value="<?php echo set_value('escrow_due'); ?>"/>
                                           <span class="input-group-addon">USD</span>
                                </div>
                                 <?php echo form_error('escrow_due') ?>
                            </div>
                            <?php }?>
                            
                        <div class="preferences col-md-12 no-padding">
                        	<div class="title-preferences col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Freelancer Preferences') ?></div>
                            </div>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Do you want freelancers to find and apply to your job?') ?></div>
                            </div>
							<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-6 col-sm-12 col-md-12 col-xs-12 input-group">
                                    <?php
                                    $is_private = '';
                                    if($this->input->post('is_private')){
                                        $is_private = $this->input->post('is_private');
                                    }elseif(isset($same_project)){
                                        $is_private = $same_project->is_private;
                                    }
                                    ?>
                                    <label><input type="radio" name="is_private" value="1" <?php echo ($is_private == 1)?"checked":''?>> <?php echo $this->lang->line('Anyone can find and apply to this job.')?></label>
                                    <label><input type="radio" name="is_private" value="2" <?php echo ($is_private == 2)?"checked":''?>> <?php echo $this->lang->line('Only Applancer users can find this job.')?></label>
                                    <label><input type="radio" name="is_private" value="3" <?php echo ($is_private == 3)?"checked":''?>> <?php echo $this->lang->line('Only freelancers I have invited can find this job.')?></label>
                                </div>
                                 <?php echo form_error('is_private') ?>
                            </div>
                            
                            <!-- 
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Preferred Qualifications') ?></div>
                            </div>
                             -->
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Minimum Feedback Score') ?></div>
                            </div>
							<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding input-group">
                                    <div class="col-lg-12 preference-rate">
                                        <?php
                                        $provider_rate = '';
                                        if($this->input->post('provider_rated')){
                                            $provider_rate = $this->input->post('provider_rated');
                                        }elseif(isset($same_project)){
                                            $provider_rate = $same_project->provider_rated;
                                        }
                                        ?>
                                    	<label>
	                                    	<input <?php echo ($provider_rate == 1)?"checked":'';?> type="radio" name="provider_rated" value="1">
	                                    	<span><input id="preview-user" value="1" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" disabled></span>
                                    	</label>
                                    	<label>
	                                    	<input <?php echo ($provider_rate == 2)?"checked":'';?> type="radio" name="provider_rated" value="2">
	                                    	<span><input id="preview-user" value="2" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" disabled></span>
                                    	</label>
                                    	<label>
	                                    	<input <?php echo ($provider_rate == 3)?"checked":'';?> type="radio" name="provider_rated" value="3">
	                                    	<span><input id="preview-user" value="3" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" disabled></span>
                                    	</label>
                                    	<label>
	                                    	<input <?php echo ($provider_rate == 4)?"checked":'';?> type="radio" name="provider_rated" value="4">
	                                    	<span><input id="preview-user" value="4" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" disabled></span>
                                    	</label>
                                    	<label>
	                                    	<input <?php echo ($provider_rate == 5)?"checked":'';?> type="radio" name="provider_rated" value="5">
	                                    	<span><input id="preview-user" value="5" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" disabled></span>
                                    	</label>
                                    </div>
                                </div>
                                 <?php echo form_error('provider_rated') ?>
                            </div>
                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 x8-15-b margin-top-bottom">
                                <div class="widgetText col-xs-12 no-padding"><?php echo $this->lang->line('Location') ?></div>
                            </div>
							<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" style="margin-top:5px;">
                                <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding input-group">
                                    <div class="col-lg-12 countries" >
                                    	<?php 
                                    	if($countries->num_rows() > 0){
                                            $projectCountry = '';
                                            if($this->input->post('locations')){
                                                $projectCountry = $this->input->post('locations');
                                            }elseif(isset($same_project)){
                                                $projectCountry = explode(',',$same_project->locations);
                                            }
											foreach($countries->result() as $item){
                                                if($projectCountry != '' && in_array($item->id,$projectCountry)){
                                                    $checked = TRUE;
                                                }else{
                                                    $checked = FALSE;
                                                }

                                                if($checked == true){
                                                    echo "<label class='label-country'><input type='checkbox' name='locations[]' checked  value='".$item->id."'>".$item->country_name."</label>";
                                                }else{
                                    	            echo "<label class='label-country'><input type='checkbox' name='locations[]' value='".$item->id."'>".$item->country_name."</label>";
                                                }
                                    		}
                                    	}
                                    	?>
                                    </div>
                                    <a id="more-country" style="float: right;padding: 5px;cursor:pointer;"><?php echo $this->lang->line('View more')?></a>
                                </div>
                                 <?php echo form_error('provider_rated') ?>
                            </div>
                         </div>
                            


                            <div class="col-lg-12 col-sm-12 col-xs-12 col-md-12">
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding">
                                    <button type="submit" name="createProject" value="createProject"
                                            class="btn btn-lg dang_du_an col-lg-3 col-md-3 col-sm-4 col-xs-12"><i
                                            class="icon_upload"></i><?php echo $this->lang->line('Post Project Now') ?>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


    <script type="text/javascript">
        $(document).ready(function () {
            $.validator.addMethod('lessThan',function(value,element,param){
                if(this.optional(element)) return true;
                var j = parseInt(value);
                var i = parseInt($('#customize_budget_min').val());
                return j > i;
            },'Ngân sách tối đa phải lớn hơn ngân sách tối thiểu');
            
            $("#form-project-post").validate({
            	errorElement: "span", // contain the error msg in a span tag
                errorClass: 'help-block',
                errorPlacement: function (error, element) { // render error placement for each input type
                    if (element.attr("type") == "radio" ) { // for chosen elements, need to insert the error after the chosen container
                        error.insertAfter($(element).closest('.form-group').children('div').children().last());
                    } else if (element.attr("name") == "dd" || element.attr("name") == "mm" || element.attr("name") == "yyyy") {
                        error.insertAfter($(element).closest('.form-group').children('div'));
                    } else if (element.attr("type") == "file" ) {
                        error.insertAfter($(element).closest('.form-group').children('div').last());
                    } else if (element.attr("type") == "checkbox" ) {
                        error.appendTo($(element).closest('.form-group'));
                    } else {
                        error.insertAfter(element);
                        // for other inputs, just perform default behavior
                    }
                },
                highlight: function (element) {
                    $(element).closest('.help-block').removeClass('valid');
                    // display OK icon
                    $(element).closest('.form-group').removeClass('has-success').addClass('has-error').find('.symbol').removeClass('ok').addClass('required');
                    // add the Bootstrap error class to the control group
                },
                unhighlight: function (element) { // revert the change done by hightlight
                    $(element).closest('.form-group').removeClass('has-error');
                    // set error class to the control group
                },
                success: function (label, element) {
                    label.addClass('help-block valid');
                    // mark the current input as valid and display OK icon
                    $(element).closest('.form-group').removeClass('has-error').addClass('has-success').find('.symbol').removeClass('required').addClass('ok');
                },
                rules: {
                	"group_parent": {
                        required: true
                    },
                    "group[]": {
                        required: true
                    },
                    "project_name": {
                        required: true,
                        //minlength: 5
                    },
                    "project_categories": {
                        required: true,
                        //minlength: 5
                    },
                    "description":{
                        required: true,
                    },
                    "customize_budget_min": {
                        required: true,
                        digits: true
                    },
                    "customize_budget_max": {
                        required: true,
                        digits: true,
                        min: $('#customize_budget_min').val(),
                        lessThan : $('#customize_budget_max').val()
                    }
                },
                messages: {
                    "group_parent": {
                        required: "<?php echo $this->lang->line('group_parent_required')?>"
                    },
                    "group[]": {
                        required: "<?php echo $this->lang->line('group_required')?>"
                    },
                    "project_name": {
                        required: "<?php echo $this->lang->line('project_name_required') ?>",
                        //minlength: "<?php echo $this->lang->line('project_name_required'); ?>"
                    },
                    "project_categories": {
                        required: "<?php echo $this->lang->line('category_required')?>",
                        //minlength: "<?php echo $this->lang->line('category_required'); ?>"
                    },
                    "description": {
                        required: "<?php echo $this->lang->line('project_description_required');?>",
                        minlength: "<?php echo $this->lang->line('project_description_required'); ?>"
                    },
                    "customize_budget_min": {
                        required: "<?php echo $this->lang->line('customize_budget_min_required') ?>",
                        digits: "<?php echo $this->lang->line('customize_budget_min_digit') ?>"
                    },
                    "customize_budget_max": {
                        required: "<?php echo $this->lang->line('customize_budget_max_required') ?>",
                        digits: "<?php echo $this->lang->line('customize_budget_max_digit')?>"
                    },
                    "escrow_due": {
                        required: "<?php echo $this->lang->line('escrow_required') ?>"
                    }
                }
            });

            <?php //if(!isset($projectTemplate)){?>
            /*$("#form-project-post input[name='attachment']").rules("add", {
                required: true,
                messages: {
                    required: "<?php //echo $this->lang->line('file_required')?>"
                }
            });*/
            <?php //} ?>
        });

    </script>
<?php $this->load->view('footer'); ?>